<!-- 消息中心导航栏 -->
<template>
<div>
    <el-row :gutter="10">
        <el-col :xs="24" :md="4" >
            <div class="tMessageBox">
                <div class="title">
                    <i style="margin-right: 10px;font-size: 16px" class="el-icon-s-promotion"></i>消息中心
                </div>
                <li class="sysmsg-item">
                    <ul class="ul-item" @click="handleMsgStatus('comment')">
                        <a :style="item=='comment'?'transition: all 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0s;font-size: 1.2em;color: #2faee3;':''" href="javascript:void(0);" title="回复我的">回复我的</a>
                    </ul>
                </li>
                <!-- <li class="sysmsg-item">
                    <ul class="ul-item" @click="$route.query.item!='like'?$router.push({path:'/Message?item=like'}):''">
                        <a :style="item=='like'?'transition: all 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0s;font-size: 1.2em;color: #2faee3;':''" href="javascript:void(0);" class="" title="收到的赞">收到的👍</a>
                    </ul>
                </li>
                <li class="sysmsg-item">
                    <ul class="ul-item" @click="$route.query.item!='follow'?$router.push({path:'/Message?item=follow'}):''">
                        <a :style="item=='follow'?'transition: all 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0s;font-size: 1.2em;color: #2faee3;':''" href="javascript:void(0);" class="" title="关注我的">关注我的</a>
                    </ul>
                </li> -->
            </div>
        </el-col>
        <msg-list :item="item"></msg-list>
    </el-row>
</div>
</template>

<script>
import { updateSysMessageStatus } from '../api/message'
import msgList from './sysMessage.vue'

export default {
    data() { //选项 / 数据
        return {
            commentList: [],
            loading: true,
            item: 'comment'
        }
    },
    methods: { //事件处理器
        routeChange() {
            this.item = this.$route.query.item==undefined?'comment':this.$route.query.item;//获取传参的login
            // console.log('item:',this.item);
        },
        handleMsgStatus(type) {
            this.$route.query.item!='comment'?this.$router.push({path:'/Message?item=comment'}):'';
        }
    },
    components: { //定义组件
        'msg-list': msgList
    },
    watch: {
        '$route':'routeChange'
    },
    created() { //生命周期函数
        this.item = this.$route.query.item==undefined?'comment':this.$route.query.item;//获取传参的login
    }
}
</script>

<style>
.tMessageBox{
    background: #fff;
    padding: 14px 16px 24px 16px;
    border-radius: 5px;
    height:89vh;
}
.tMessageBox h1{
    padding:15px 0;
    font-size: 25px;
    font-weight: bold;
}
.tMessageBox .tf-item{
    transition: all 0.3s ease-out;
    border-radius: 5px;
    position: relative;
}
.tMessageBox .tf-item a{
    display: block;
    padding:0;
    height:90px;
}
.tMessageBox .tf-item a img{
    width:60px;
    height:60px;
    border-radius: 50%;
    position: absolute;
    top:15px;
    left:15px;
    cursor: pointer;
    object-fit: cover;
}
.tMessageBox .tf-item a h4{
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    /* overflow: hidden; */
    font-size: 20px;
    padding-top:15px;
    font-weight: bold;
}
.tMessageBox .tf-item a p{
    margin:10px 0;
    font-size: 12px;
    line-height: 24px;
    color:#999;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tMessageBox .title {
    height: 62px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: #333;
    font-weight: bold;
    border-bottom: 1px solid rgba(239,239,239,.8);
}
.sysmsg-item {
    border-bottom: 1px solid rgba(239,239,239,.8);
    list-style: none;
}
.sysmsg-item .ul-item {
    padding: 15px 0 15px 0;
    text-align: center;
    cursor: pointer;
}
.sysmsg-item .ul-item a {
    font-size: 14px;
    font-weight: 700;
    color: #6B757B;
    cursor: pointer;
}
.sysmsg-item .ul-item a:hover {
    color: #2faee3;
}
</style>
